import request from '@/utils/request'
import {Toast } from 'vant';

export function api_homebanner() {
    return request({
        url: '/home/banner',
        method: 'get',
    })
}

export function api_homemenu(role) {
    return request({
        url: '/home/menu',
        method: 'get',
        params: { role }
    })
}

export function api_homenews() {
    return request({
        url: '/home/news',
        method: 'get',
    })
}

export function api_homeintrolist() {
    return request({
        url: '/home/intro/list',
        method: 'get',
    })
}

export function api_homeorder() {
    return request({
        url: '/home/order',
        method: 'get',
    })
}

export function api_userRole() {
    return request({
        url: '/user/role',
        method: 'get',
    })
}

export function api_newsListWithPage(page) {
    var data = {
      current:page,
      size:20,
        status:1
    };
    return request({
        url: 'news/list',
        method: 'post',
        data
    })
}


export function api_newsDetail(newsId) {
    return request({
        url: '/news/detail/'+newsId,
        method: 'get',
    })
}

export function api_introDetail(newsId) {
    return request({
        url: '/intro/detail/'+newsId,
        method: 'get',
    })
}